package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class TestConnection {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/";
        String user="root";
        String pwd="root";

        Connection con = DriverManager.getConnection(url,user,pwd);
        System.out.println("连接成功"+con);
    }
}
